----------------------------
-- Simplistic Street
-- by Jammie Dodger
--
-- Project Started - October 20, 2009
-- Completion -None
----------------------------

concommand.Add( "printentpos", function(ply)
local trace = util.GetPlayerTrace(ply)
local tr = util.TraceLine(trace)
local posx = tr.Entity:GetPos().x
local posy = tr.Entity:GetPos().y
local posz = tr.Entity:GetPos().z
print("Vector(" ..posx.. ", "..posy..", "..posz..")")
end )

concommand.Add( "printentname", function(ply)
local trace = util.GetPlayerTrace(ply)
local tr = util.TraceLine(trace)
print(tr.Entity)
end )

concommand.Add( "printentmodel", function(ply)
local trace = util.GetPlayerTrace(ply)
local tr = util.TraceLine(trace)
print(tr.Entity:GetModel())
end )

concommand.Add( "printentang", function(ply)
local trace = util.GetPlayerTrace(ply)
local tr = util.TraceLine(trace)
local anglep = tostring(tr.Entity:GetAngles().p)
local angley = tostring(tr.Entity:GetAngles().y)
local angler = tostring(tr.Entity:GetAngles().r)
print("Angle(" ..anglep.. ", "..angley..", "..angler..")")
end )



function ReceiveCoOwners(um)

local Door = um:ReadEntity()
local Entity = um:ReadEntity()
Door.CoOwners = Door.CoOwners or {}

table.insert(Door.CoOwners, Entity:UniqueID())


end

usermessage.Hook("CoOwners", ReceiveCoOwners)

function EmptyTable(um)

local Door = um:ReadEntity()

if Door.CoOwners then
	Door.CoOwners = nil
	end
end

usermessage.Hook("EmptyOwners", EmptyTable)

function ReceiveOwners(um)

local Door = um:ReadEntity()
local Owner = um:ReadEntity()

	Door.Owners = Owner or nil
end

usermessage.Hook("ReceiveOwners", ReceiveOwners)

function _R.Player:Money()

	return self:GetNWInt("Money")
	
end
